package com.jww.dao.user;

import com.jww.pojo.User;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

public interface UserDao {

    //得到要登录的用户
    public User getLoginUser(Connection conn,String userCode) throws SQLException;

    //修改当前用户密码
    public int updatePwd(Connection conn,int id,String password) throws SQLException;

    //根据用户名或者用户角色查询用户总数
    public int getUserCount(Connection conn,String username,int userRole) throws SQLException;

    //通过条件查询用户列表
    public List<User> getUserList(Connection conn,String username, int userRole, int currentPageNo,int pageSize) throws SQLException;

    //添加用户
    public int add(Connection conn,User user) throws SQLException;

    //删除用户
    public int deleteUserById(Connection conn, int id) throws SQLException;

    // 修改用户信息
    public int modify(Connection connection, User user)throws Exception;

    // 通过userId查询user
    public User getUserById(Connection connection, String id)throws Exception;

}
